<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/taglib.jsp" %>
<%@ include file="/WEB-INF/jsp/loading.jsp" %>
<%
	String path = request.getContextPath();
%>
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>用户操作日志</title>
<style type="text/css">
	.icon-xls {
   		background: url("<%=path%>/images/excel.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
	}
</style>
<script type="text/javascript">
		var path = "<%=path%>";
		var params = new Object();
		var url = path+"/system/userlog/list";
		$(function(){
			//设置AjaxLoading
			setAjaxLoading();
			var grid=$("#tt");
			initGrid(grid);
		});

		//初始化表格和数据
		function initGrid(grid) {
		    var columns=[
			            { field: "logId", title: "ID", hidden: true, align: "left", sortable: false, resizable: true, width: 120},
			            { field: "userCode", title: "用户账号", align: "left",halign: "center", sortable: false, resizable: true, width: 130},
			            { field: "userName", title: "用户名称", align: "left",halign: "center", sortable: false, resizable: true, width: 135},
			            { field: "content", title: "操作内容", align: "left",halign: "center", sortable: false, resizable: true, width: 120},
			            { field: "createTimeStr", title: "操作时间", align: "left",halign: "center", sortable: false, resizable: true, width: 190},
			        ];
		    initPageGrid(grid, params, url,columns,"#tb");
		    btnQuery();
		}
		//查询按钮
		function btnQuery(){
			var grid=$("#tt");
			params.userName = $('#userName').val();
			params.createTimeStart = $('#create_time_start').val();
			params.createTimeEnd = $('#create_time_end').val();
    		getPage(grid,params,url);
		}
		
		function btnExport(){
			var userName = $('#userName').val();
			var czrq_q = $('#czrq_q').val();
			var czrq_z = $('#czrq_z').val();
			var download_url = String.format("<%=path%>/system/userlog/downloadRyczsj");
			document.getElementById("ifile").src = download_url;
		}
		</script>
</head>

<body style="margin:0px; padding:0px;">
	<div class="easyui-layout" fit="true">
		<div id="divNorth" region="north" title="查询条件" border="true" noheader="false" style="padding: 5px; height: 71px; background: none repeat scroll 0 0 #EFEFEF;">
			<table>
				<tr>
					<td>用户名称：</td>
					<td><input class="query_input" type="text" id="userName" name="yhcodeName" style="width: 120px" /></td>
					<td>操作时间：</td>
					<td style="width: 210px;">
						<input id="create_time_start" class="query_input Wdate"  style="width:85px"
							   onClick="WdatePicker({maxDate:'#F{$dp.$D(\'create_time_end\')}',dateFmt:'yyyy-MM-dd',readOnly:true});"  />
						至
						<input id="create_time_end" class="query_input Wdate"  style="width:85px"
							   onClick="WdatePicker({minDate:'#F{$dp.$D(\'create_time_start\')}',dateFmt:'yyyy-MM-dd',readOnly:true});" />
					</td>

					<td><input class="search-btn-blue" style="margin-left:10px" type="button" onclick="btnQuery();" value="查询"></td>
				</tr>
			</table>
		</div>
		<iframe id="ifile" style="display:none"></iframe>
		<div region="center" style="padding: 5px;" border="false">
			<div class="easyui-layout" fit="true" border="false">
				<div region="center" title="" border="false" noheader="true" style="padding: 5px 0 0 0;">
					<table id="tt" title="" border="false"></table>
				</div>
			</div>
		</div>
	</div>
	<%--<div id="tb" style="padding: 1px; height: auto; display: none;">
		<div>
			<a id="btn_addNode_tb" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-xls" plain="false" onclick="btnExport()">导出</a> 
		</div>
	</div>--%>
</body>
</html>
